
import React from 'react'
import { Card, Drawer, Popover, Table} from 'antd'
import {
    ReloadOutlined
} from '@ant-design/icons'
import "./index.css"

function TableCompon(props:any) {
    const  seteditVisible = ()=>{

    }
    const { columns,title,tableData,pageChange } = props // 父组件传入数据
    return (
       <Card className="TableCompon search-form-table">
            <div className="handleTitle">
                <h3>{title}</h3>
                <Popover content="刷新">
                    <ReloadOutlined onClick={()=>{pageChange(1)}}/>
                </Popover>
            </div>
            <Table
                // loading={getAccess.loading}
                pagination={{
                    hideOnSinglePage: true, simple: true, pageSize: 10,
                    total: tableData.total,onChange:pageChange,current:tableData.page
                }}
                onRow={(record: any) => {
                    return { onClick: () => { } }
                }} rowKey={(record: any) => record.id} columns={columns}
                // dataSource={data}
                dataSource={tableData.rows}
            />
       </Card>
    )
}

export default TableCompon
